home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr34 / jam125sw.zip / EXTEND.BAT < prev    next >
DOS Batch File  |  1995-03-10  |  2KB  |  66 lines

  1. @echo off
  2.  
  3. rem JAM R1.20, EXTEND.BAT -- automatically enlarges a JAM drive. 
  4. rem Sun Jul 10 1994, written by George A. Reznik.
  5. rem Copyright (c) 1992-1994 JAM Software.
  6. rem All Rights Reserved.
  7.  
  8. echo EXTEND 1.20  Copyright (c) JAM Software, 1992-1994. All rights reserved.
  9. echo:
  10.  
  11. if "%1" == "" goto usage
  12. if not "%1" == "/?" goto getinfo
  13.  
  14. :usage
  15. echo Automatically enlages the size of a JAM drive.
  16. echo Use:
  17. echo     EXTEND drive: [size]
  18. echo Where:
  19. echo     drive  JAM drive to extend
  20. echo     size   Specifies amount of physical space (in Kbytes) 
  21. echo            on which JAM drive should be extended.
  22. echo            If not specified the maximum possible value is used.
  23. echo Example:
  24. echo     EXTEND D: -- extend the size of JAM drive D:
  25. echo Note:
  26. echo     Do not run this batch file from the drive you want to extend.
  27. goto end
  28.  
  29. :getinfo
  30. jmount /q %1 > extend2.bat
  31. if errorlevel 1 goto end
  32. if not exist extend2.bat goto cerror
  33.  
  34. echo Building secondary command file ...
  35.  
  36. echo if not "%%4" == "available" goto chkflags    >  jam.bat
  37. echo echo JAM drive %%2 not mounted.        >> jam.bat
  38. echo goto end                    >> jam.bat
  39. echo :chkflags                    >> jam.bat
  40. echo if not "%%5" == "[Locked]" goto unmount    >> jam.bat
  41. echo echo JAM drive %%2 locked.            >> jam.bat
  42. echo goto end                    >> jam.bat
  43. echo :unmount                    >> jam.bat
  44. echo echo Deactivating JAM drive %%2 ...    >> jam.bat
  45. echo jmount /q /d %%2                >> jam.bat
  46. echo if errorlevel 1 goto end            >> jam.bat
  47. echo echo Extending the size of %%4 ...        >> jam.bat
  48. echo jsize /q %%4 +%2                >> jam.bat
  49. echo if errorlevel 1 goto end            >> jam.bat
  50. echo echo Remounting JAM drive %%2 ...        >> jam.bat
  51. echo jmount /q /m %%2 %%4            >> jam.bat
  52. echo :end                    >> jam.bat
  53. if exist jam.bat goto run
  54.  
  55. :cerror
  56. echo Cannot create a file on current drive.
  57. goto end
  58.  
  59. :run
  60. call extend2.bat
  61. del extend2.bat
  62. del jam.bat
  63.  
  64. :end
  65.  
  66.